from selenium import webdriver
from time import sleep
import os
from selenium.webdriver.common.by import By

'''
通过父元素定位子元素
'''
driver = webdriver.Firefox()
html_file = os.getcwd() + os.sep + 'myhtml5_2.html'
driver.get(html_file)
# mytext = driver.find_element(By.XPATH, "B").text

# print(mytext)
# driver.quit()